package junits.condition_test;


import com.hedl.practice.diyJava.junit.study_condition_test.test.Config;
import org.junit.Test;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.*;

import static org.junit.Assert.*;

public class Main {
    Config config;

    @BeforeEach
    public void setUp(){this.config = new Config();}

    @Test
    @EnabledOnOs(OS.WINDOWS)
    public void testWindows(){assertEquals("C:\\test.ini",config.getConfigFile("test.cfg"));}

    @Test
    @Disabled("bug-101")
    public void testBug101(){
        // TODO: this test is disabled for bug fixing
    }

    @Test
    @DisabledOnOs(OS.WINDOWS)
    public void testOnNonWindowsOs(){
        // TODO: this test is disabled on windows
    }

    @Test
    @DisabledOnJre(JRE.JAVA_8)
    public void testOnJava90rAbove(){
        // TODO: this test is disabled on java 8
    }

    @Test
    @EnabledIfSystemProperty(named = "os.arch",matches = ".*64.*")
    public void testOnlyOn64bitSystem(){
        // TODO: this test is only run on 64 bit system
    }

    @Test
    @EnabledIfEnvironmentVariable(named = "DEBUG",matches = "true")
    public void testOnlyOnDebugMode(){
        // TODO: this test is only run on DEBUG=true
    }
}
